import langchain_helpers as lch
import streamlit as st
from langchain.output_parsers import StructuredOutputParser, ResponseSchema

st.title("宠物命名助手")

animal_type = st.sidebar.selectbox("您的宠物是？", ("狗","猫", "牛", "蛇"))
animal_lables = {
    "狗": "您的狗的颜色？",
    "猫": "您的猫的颜色？",
    "牛": "您的牛的颜色？",
    "蛇": "您的蛇的颜色？",
}

pet_color = st.sidebar.text_area(
    label = animal_lables[animal_type],
    max_chars = 25
)

if pet_color:
    response = lch.generate_pet_name(animal_type, pet_color)
    st.text(response.content)